Gate Network Theory